#ifndef _MUNIX_CFG_H_
#define	_MUNIX_CFG_H_
/*******************************************************************************
 ** Name: cfg.h                                                               **
 ** Description: Contains definitions for memory locations.                   **
 **                                                                           **
 ** Open Source Initiative (OSI) Approved License                             **
 **                                                                           **
 ** The contents of this file are subject to the terms of the                 **
 ** Common Development and Distribution License, Version 1.0 only             **
 ** (the "License").  You may not use this file except in compliance          **
 ** with the License.                                                         **
 **                                                                           **
 ** You can find a copy of the license in the license.txt within              **
 ** this distribution or at http://www.munixos.net/licensing.                 **
 ** Software distributed under the License is distributed on an "AS IS"       **
 ** basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.           **
 ** See the License for the specific language governing permissions           **
 ** and limitations under the License.                                        **
 **                                                                           **
 ** When distributing Covered Code, include this CDDL header in each          **
 ** file and include the License file at $HOME/license.txt.                   **
 ** If applicable, add the following below this header, with the indicated    **
 ** fields enclosed by brackets "[]" replaced with your own identifying       **
 ** information: Portions Copyright [yyyy] [name of copyright owner]          **
 **                                                                           **
 **                                                                           **
 ** Copyright (c) 2009-2010  Barry Gian James.                                **
 ** All rights reserved.                                                      **
 **                                                                           **
 ** Ref: $HeadURL$
 ******************************************************************************/
// Portions (C) 2011 OpenHouseware, LLC.
// All Rights Reserved

// $Id$
#define _MUNIX_CFG_ID "$Id$"
// Last Modified $DateTime: 2010/02/12 01:42:30 $ by $Author$

// Below are the definitions and corresponding address in configuration flash
// for the ATBIOS configuration
#define BIOS_VERSION_MAJ    0x000000
#define BIOS_VERSION_MIN    BIOS_VERSION_MAJ + 1
#define BIOS_CRC            BIOS_VERSION_MIN + 1

#define BIOS_CFG_STANDARD
#define BIOS_STD_CFG_TIME   0x000006                // mm/dd/yy hh:mm
#define BIOS_STD_DST        BIOS_STD_CFG_TIME + 8   // daylight savings time (y/n)
#define BIOS_STD_TIMEZONE   BIOS_STD_DST + 1        // uint8 enum
#define BIOS_STD_SSD        BIOS_STD_TIMEZONE + 1   // secondary storage device enum
#define BIOS_STD_PFS        BIOS_STD_SSD + 1        // primary file system type enum
#define BIOS_STD_DISP_HSYNC BIOS_STD_PFS + 1        // horizontal sync
#define BIOS_STD_DISP_VSYNC BIOS_STD_DISP_HYSNC + 1 // vertical sync (60,70Hz)
#define BIOS_STD_DISP_RES   BIOS_STD_DISP_VSYNC + 1 // support resolutions enum
#define BIOS_STD_KBD        BIOS_STD_DISP_RES + 1   // ps2=1,sparc=2,usb=3
#define BIOS_STD_MOUSE      BIOS_STD_KBD + 1

#define BIOS_CFG_ADVANCED   BIOS_STD_MOUSE + 1
#define BIOS_ADV_KBD_TYPE   BIOS_CFG_ADVANCED       // typematic rate uint8
#define BIOS_ADV_KBD_DELAY  BIOS_ADV_KBD_TYPE + 1   // typematic delay
#define BIOS_ADV_QUICKBOOT  BIOS_ADV_KBD_DELAY + 1  // bool
#define BIOS_ADV_MEMTST_SOUND BIOS_ADV_QUICKBOOT + 1 // bool
#define BIOS_ADV_MEM_PARITY BIOS_ADV_MEMTST_SOUND + 1 // parity check bool
#define BIOS_ADV_ACK_WARN   BIOS_ADV_MEM_PARITY + 1 // acknowledge all warnings bool
#define BIOS_ADV_ACK_ERR    BIOS_ADV_ACK_WARN + 1   // "   " errors bool
#define BIOS_ADV_KBD_NUML   BIOS_ADV_ACK_ERR + 1    // bootup numlock bool
#define BIOS_ADV_KBD_CAPSL  BIOS_ADV_KBD_NUML + 1   // bootup caps lock bool
#define BIOS_ADV_BOOT_SEQ   BIOS_ADV_KBD_CAPSL + 1  // bootup sequence (enum)
    // internal flash, external flash, secondary storage, network
#define BIOS_ADV_BOOT_PWD   BIOS_ADV_BOOT_SEQ + 1   // bootup password (char[8]
#define BIOS_ADV_SHADOW_BIOS BIOS_ADV_BOOT_PWD + 8  // shadow bios to RAM
// video submenu
#define BIOS_VID_SHADOW_BIOS BIOS_ADV_SHADOW_BIOS + 1
#define BIOS_VID_ENA_FRAMEB BIOS_VID_SHADOW_BIOS + 1    // enable frame buffer in SDRAM
#define BIOS_VID_RES                                // video resolution - TODO COPY
#define BIOS_VID_MODE                               // color/greyscale,b/w enum
#define BIOS_VID_TYPE                               // vga, cga, NTSC enum
#define BIOS_ADV_BASE_RAM                           // uint16/24
#define BIOS_ADV_BASE_FLASH
#define BIOS_ADV_IO_ADDR                            // IO address of BIOS
#define BIOS_ADV_IO_RTC                             // IO address of RTC
#define BIOS_ADV_IO_TEMP                            // IO address of temp ctrlr
#define BIOS_ADV_ISP_ENA                // bool (false). if true on next boot enter ISP programming mode

#define BIOS_CFG_MCU
#define BIOS_MCU_NAME                   // char [12]
#define BIOS_MCU_SIG                    // device signature
#define BIOS_MCU_FAMILY                 // tiny, mega, xmega
#define BIOS_MCU_ARY                    // number of MCU's
#define BIOS_MCU_FCPU
#define BIOS_MCU_CLOCK_SRC      // crystal, driver enum
#define BIOS_MCU_MAX_VOLT       // maximum voltage
#define BIOS_MCU_ALARM_VOLTL     // alarm on what low voltage
#define BIOS_MCU_ALARM_VOLTH    // alarm on what high voltage
#define BIOS_MCU_ALARM_TEMP     // alarm at what temp

#define BIOS_CFG_BUS
#define BIOS_BUS_CLKOUT     // output bus clock to <port/pin> TODO (type: ??)
#define BIOS_BUS_ENA_SPI
#define BIOS_BUS_ENA_I2C
#define BIOS_BUS_MODE           // async (clk/cpu), sync (clk/bus)
#define BIOS_BUS_MEM_WAIT
#define BIOS_BUS_DMA_CLK        // clk/atbios, clk/bus enum
#define BIOS_BUS_IO_RECOVERY        // number of wait states inserted b/w 2 consecutive IO ops
#define BIOS_BUS_ENA_MULTIPLEX  // enable multiplexed address/data bus (bool true)
#define BIOS_BUS_RAM_ACTIVE     // microsec how long can we hold the memory bus?
// data write wait state (determines length of time the sys willd elay while data is
// being written/read to/from target address. These values help fine tune the system
#define BIOS_BUS_MCU_TO_MCU_WR      // MCU master write to MCU bus (SHORTBUS)
#define BIOS_BUS_MCU_TO_MCU_RD
#define BIOS_BUS_MCU_TO_DATA_WR
#define BIOS_BUS_MCU_TO_DATA_RD
#define BIOS_BUS_MCU_TO_IO_WR
#define BIOS_BUS_MCU_TO_IO_RD
#define BIOS_BUS_MCU_TO_VIDEO_WR
#define BIOS_BUS_MCU_TO_VIDEO_RD
#define BIOS_BUS_DEV_TO_IO_WR
#define BIOS_BUS_DEV_TO_IO_RD
#define BIOS_BUS_DEV_TO_DATA_WR
#define BIOS_BUS_DEV_TO_DATA_RD
#define BIOS_BUS_ENA_ALE            // address latch enable (bool true)

#define BIOS_CFG_EXT
#define BIOS_EXT_ETH_MAC            // ethernet mac address
#define BIOS_EXT_IDE_ENA        // enable IDE support
#define BIOS_EXT_IDE_CLK        // IDE bus speed
#define BIOS_EXT_SD_TYPE        // mini micro SD card (enum)
#define BIOS_EXT_SD_SIZE
#define BIOS_EXT_SD_SPEED
#define BIOS_EXT_SD_PAGES
#define BIOS_EXT_SD_PAGESZ
#define BIOS_EXT_SD_BLOCKS
#define BIOS_EXT_SD_BLOCKSZ
#define BIOS_EXT_SD_SECTORS
#define BIOS_EXT_SD_SECTORSZ

#define BIOS_CFG_PWR
#define BIOS_PWR_TIME_SLEEP     // tim to sleep in min
#define BIOS_PWR_TIME_STDBY     // time to standby
#define BIOS_PWR_TIME_SLOW      // tim to slowdown
#define BIOS_PWR_TIME_MONITOR   // time to turn off monitor


struct BIOSPOSTCodes
{
	int				code;
	const char *	desc;
};

extern BIOSPOSTCodes	PostCodes[] PROGMEM;


#endif	/* _MUNIX_CFG_H_ */

